package com.sgs.carbon.web.modules.common.controller.captcha;

import com.sgs.carbon.common.pojo.CommonResult;
import com.sgs.carbon.starter.web.core.controller.BaseController;
import com.sgs.carbon.web.modules.common.controller.captcha.vo.SysCaptchaImageRespVO;
import com.sgs.carbon.web.modules.common.service.captcha.SysCaptchaService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 验证码管理 Controller
 *
 * @author Dave Liu
 * @date 2021-10-08
 */
@RestController
@Api(tags = "验证码管理")
@RequestMapping("/captcha")
public class SysCaptchaController extends BaseController {

    @Autowired
    private SysCaptchaService captchaService;

    @GetMapping("/get-image")
    @ApiOperation("生成图片验证码")
    public CommonResult<SysCaptchaImageRespVO> getCaptchaImage() {
        return success(captchaService.getCaptchaImage());
    }

}
